home *** CD-ROM | disk | FTP | other *** search
/ BBS in a Box 15 / BBS in a box XV-2.iso / Files II / Prog / B-C / C++Source Code Fmtr.sit / MacApp CDent Stuff / MacApp CDent Stuff
Encoding:
Text File  |  1991-03-25  |  1.2 KB  |  26 lines  |  [TEXT/MPS ]

  1. # John,
  2. #     We put this variable initialization in the MacApp startup file, which gets executed at
  3. #    MPW Startup time. Then people can use how they like.
  4.  
  5. #    {MACPlusFormat} - Format string for CDent, the C++ code formatter.
  6.             SET MACPlusFormat ∂
  7.                 '-ll 512 -decl0 "&n dl0" ∂
  8.                 -fundef4 "• &n" -fundef8 "i+®0 s • &n" -fundef10 "?n∂{• s#}∂{•/?n∂{s#}∂{&n c®2}}" -fundef13 "&n c®2-®0 • n" -fundef14 "&n c®2-®0 • n" ∂
  9.                 -if4 "&n • &n i+®0" -if6 "&n c®2-®0 &n • &n" -else3 "&n • &n • i+®0" ∂
  10.                 -struct3 "&n• n# i+®0" ∂
  11.                 -switch2 "&n • n# i+®0 i+®0" -switch3 "&n c®2-®0 • &s" -switch7 "i-®0 c®2-®0 &n • n#" ∂
  12.                 -while2 "&n • n# i+®0" ∂
  13.                 -for5 "&n • n# i+®0" ∂
  14.                 -do2 "&n • n# i+®0"'
  15.             EXPORT MACPlusFormat
  16.  
  17.  
  18. #    Additionally, on our team we put cdent on a command key using the following bit of script.
  19. #     We can then format an entire open window or a "proper" selection. i.e. a whole function,
  20. #    or other outer level declaration.
  21.  
  22. # Set up a menu item/command key that will format C++ code, according to MacApp conventions.
  23.  
  24. AddMenu edit 'CDent §/=' '(CDent {MACPlusFormat} ∂
  25.     <"{active}.§" >"{MPW}cdentText" ≥ "{MPW}MPW.Errors" && catenate "{MPW}cdentText">"{active}.§") || alert <"{MPW}MPW.Errors"'
  26.